home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
EnigmA Amiga Run 1998 July
/
EnigmA AMIGA RUN 29 (1998)(G.R. Edizioni)(IT)[!][issue 1998-07 & 08].iso
/
recent
/
iib122.lha
/
IIB
/
Threads
/
phong_shade_prob
< prev
next >
Wrap
Internet Message Format
|
1998-04-25
|
5KB
Date: Thu, 16 Apr 1998 13:45:42 +0000
From: Thomas Flindt Hansen <zzap@MAIL.COM>
Subject: [IML] IFW: phong shade trouble.
Hi all,
I haven't used Imagine for Windows for quite some time, but recently I
found the time to sit down and play around with my fav. 3d program.
Didn't play much though cos a really weird surprise awaited me. I can't
recall having this problem before, I'm sure I'd remember then. It's the
phong shade algorithm that's completely up the spout. Whenever I render
in trace with a "cast shadow" light source, I get dark triangles along
the line of the shadow on the objects. I have uploaded two pictures to
illustrate what's happening. The first one is a default sphere (phong
enabled) where the dark triangles are very prominent. It's at:
http://www.geocities.com/heartland/3330/sphere.jpg
The second picture shows a torus where you can both see the dark
triangles AND all the other triangles that make up the torus object. It
is phong shaded like the sphere, so the triangles shouldn't be visible,
should they? It's at:
http://www.geocities.com/heartland/3330/torus.jpg
I got the same result with both version 1.3.4, 1.3.5 and also when I did
a complete reinstall of version 1.0. Now the really weird thing is that
when I transferred Imagine to my old 486, I got the same result, and a
fresh install of version 1 on the 486 yield the same thing. I should
have done it in the opposite succession to see if it was the old version
that messed things up (the reg. base, MFC, whatever). What a bummer!
I know this list is not a tech support list (have contacted impulses
tech support too), so sorry for the long entry, but I would like to know
if anyone has experienced this too? Probably doing something really
silly, I need someone to nail it for me!
----------------------------------
Date: Thu, 16 Apr 1998 14:52:02 PDT
From: Ian Stearns <buzzbuzz@HOTMAIL.COM>
-groan- :)
This has come up before and made noise for a week on the list.
Short story is--it's a feature of phong. The 'dark-triangles' are just
on the edge of the shadow...imagine has to make a choice on which side
they ultimately are on...(either-or).
This behaviour can be noted in most polygon renderers...not just
imagine.
Solution 1:
Fracture and Smooth. This minimizes the problem...sometimes solves
it.
Solution 2:
Change the angle of the light a weee bit. (I also like
fill-lights...which take away a lot of the contrast).
Good luck! Get ready for the 20 replies to your question. :)
----------------------------------
Date: Thu, 16 Apr 1998 17:37:21 +0400
From: Charles Blaquiere <blaq@INTERLOG.COM>
Thomas,
you've stumbled onto an unfortunate side effect of Imagine's new Gamma
function. The black faces are facing away from the light source;
anything over a 90-degree angle will do it. In olden days, before Gamma
lightened things up, object shading was darker, and these boundary faces
were lost in the darkness. With Gamma activated, the last faces that
still face the light (i.e. have an light/face angle <90), are now much
lighter, and you see the difference between them and their dark
neighbours.
Here's my educated guess as to what's happening: part of the renderer is
an algorithm to determine how much light is received by an object. When
Imagine is about to render a pixel belonging to a face, I believe it
first asks itself if that face is facing towards, or away from, the
current light source. If facing away, then the entire face is considered
to receive no light from that source, and the light-intensity algorithm
exits immediately. If facing towards, then angle calculations, combined
with the Phong algorithm, determine light intensity at that point.
Again, this is just a theory, but one that fits the facts at hand. You
can see why Imagine would do this: why waste precious time playing the
Phong game when a face isn't even lit by the source?
The problem, of course, occurs for borderline faces, those which, are
turned away from the light source, but have at least one immeidate
neighbour facing _towards_ the light.
The solution would be for Imagine to always perform Phong shading,
regardless whether the current face is facing away from the light
source. If a face's neighbours all faced away from the light source, the
result would still be zero light intensity; however, if one of the
neighbouring faces was turned towards the light, then the face currently
under examination would be correctly lit. This would increase rendering
time, as Imagine would perform Phong calculations on all faces, but it
would ensure that those borderline faces would stop appearing as dark
black holes.
At this point, I'd really like to get Mike's input on this.
----------------------------------